define(['app'], function(app) {
	'use strict';

	// 实例化方法
	var factory = function(Http) {
		
		function get_data_connectagency(result) {
			if(HTTP_ISLOGIC) {
				result = '{"success": true,"msg": "","result": { "act_id": "001",'+
        '"order": ['+
        	 '{"order_id": "0101","member_id": "001","name": "用户A"},'+
        	 '{"order_id": "0211","member_id": "011","name": "用户A"},'+
        	 '{"order_id": "0321","member_id": "021","name": "用户A"},'+
        	 '{"order_id": "0301","member_id": "031","name": "用户A"},'+
        	 '{"order_id": "0401","member_id": "041","name": "用户A"},'+
        	 '{"order_id": "0501","member_id": "051","name": "用户A"},'+
        	 '{"order_id": "0601","member_id": "061","name": "用户A"},'+
        	 '{"order_id": "0701","member_id": "071","name": "用户A"},'+
             '{"order_id": "0802","member_id": "002","name": "用户B"}'+
        ']},"session": "7311da98bd0f18eb15a96bcb263f4153"}';
				return JSON.parse(result);
			} else {
				return result;
			}
		}

		// 返回信息
		return {
			connectagency: function(act_id, draw_type, callback) {
				Http.post({
						method: 'marketing.seckill.draw',
						act_id: act_id,
						draw_type: draw_type,
						session:''
					},
					function(result) {
						//请求成功
						if(callback)
							callback(get_data_connectagency(result).result);
					},
					function(e) {
						//请求异常
					},
					function() {
						//请求完成，一般不做什么事情
					});
			}
			
			
		};
	}

	factory.$inject = [ 'Http' ];
	return app.registerService("Connectagency", factory);
});